package com.abc.recycling.service;

import com.abc.recycling.model.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;

public interface UserService {
    List<User> findResidents(String keyword);
    
    User findById(Long id);
    
    void create(User user);
    
    void update(User user);
    
    void updateStatus(Long id, Integer status);
    
    void delete(Long id);
    
    User register(User user);
    
    User login(String username, String password);
    
    User updateUser(User user);
    
    void updateAvatar(User user);
    
    void changePassword(Long userId, String oldPassword, String newPassword);
    
    void updatePassword(User user);
    
    User getUserById(Long id);
    
    User getUserByUsername(String username);
    
    List<User> getUsersByRole(String role);
    
    List<User> searchUsers(String role, String keyword);
    
    void updateUserStatus(Long userId, Integer status);
    
    void deleteUser(Long userId);
    
    User findByUsername(String username);
    
    long countActiveUsers();
    
    User createUser(User user);
    
    Page<User> findByRoleAndKeyword(String role, String keyword, Pageable pageable);
    
    boolean existsByUsername(String username);
    
    boolean existsByPhone(String phone);
    
    boolean existsByEmail(String email);

    /**
     * 查找回收员列表
     * @param keyword 搜索关键字(用户名/手机号/真实姓名)
     * @return 回收员列表
     */
    List<User> findCollectors(String keyword);
} 